package com.jimikongjian.dao;

import com.jimikongjian.models.RoomFollower;
import com.jimikongjian.models.UserInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by fuxiuyang on 17/2/20.
 */
public interface IRoomFollower {

    /**
     * 通过自身的id号，获取某一确定的空间关注的信息
     * @param id
     * @return List<RoomFollower>
     */
    public List<RoomFollower> getRoomFollowerListById(int id);

    /**
     * 通过自身的id号，获取某一确定的空间关注的信息
     * @param id
     * @return RoomFollower
     */
    public RoomFollower getRoomFollowerById(int id);

    /**
     * 获取用户关注的所有的空间
     * @param userId
     * @return List<RoomFollower>
     */
    public List<RoomFollower> getRoomFollowerListByUserId(int userId);

    /**
     * 获取关注该空间的所有的用户
     * @param roomId
     * @return List<RoomFollower>
     */
    public List<UserInfo> getRoomFollowerListByRoomId(@Param("roomId") int roomId,
                                                      @Param("start") int start,
                                                      @Param("length") int length);

    /**
     * 获取该空间是否具有该用户
     * @param userId
     * @param roomId
     * @return List<RoomFollower>
     */
    public List<RoomFollower> getRoomFollowerListByUserIdAndRoomId(@Param("userId") int userId, @Param("roomId") int roomId);

    /**
     * 判断该空间是否有该用户
     * @param userId
     * @param roomId
     * @return List<RoomFollower>
     */
    public boolean hasUser(int userId, int roomId);



    /**
     * 创建一条新的空间关注
     * @param roomFollower
     */
    public void insertRoomFollower(RoomFollower roomFollower);

    /**
     * 更新某一条空间关注的信息
     * @param roomFollower
     */
    public void updateRoomFollower(RoomFollower roomFollower);

    /**
     * 删除某一条空间关注的信息
     * @param roomFollower
     */
    public void deleteRoomFollower(RoomFollower roomFollower);
}
